import java.util.ArrayList;

public class Test2 {
    public static void main(String[] args) {
        ArrayList<Student> List = new ArrayList<>();
        Student s1 = new Student(18,"张三");
        Student s2 = new Student(18,"李四");
        Student s3 = new Student(19,"王五");
        List.add(s1);
        List.add(s2);
        List.add(s3);
        for (int i = 0; i < List.size(); i++) {
            Student stu = List.get(i);
            System.out.println(stu.getAge()+stu.getName());
        }
    }
}
